package edu.zut.controller;


import edu.zut.pojo.User;
import edu.zut.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class UserController {

    @Autowired
    private UserService userService;


    @GetMapping("/user/login")
    public String login(@RequestParam("username") String name, String password){
        User user = userService.findByNameAndPsw(name, password);
        System.out.println(user);
        return "success";
    }

}
